import React from 'react';
import { Button ,Modal ,message } from 'antd';

class UserTool extends React.Component{
    // constructor(props){
    //     super(props);
    // }

    render(){
    const {onAdd, onDelete, onUpdate ,selectedRows }=this.props;
    const handleDelete=()=>{
        if(selectedRows === undefined){
            message.warning("aaaaaa请至少选择一条要删除的数据");
            return;
        }
        Modal.confirm({
            title: '系统提示',
             content: '确定要删除选中的数据？',
             okText: '确认',
             cancelText: '取消',
             onOk:()=>{
                onDelete()},
        })
    }
    return(
        <div>
            <Button type='primay' onClick={onAdd}>新增</Button>
            <Button type='dashed' onClick={onUpdate}>编辑</Button>
            <Button type='danger' onClick={handleDelete}>删除</Button>
        </div>
    )
    }
}

export default UserTool;
